/*
	POJ:2352
*/
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
int c[32010];
int lowbit(int x)
{
	return x&(-x);
}
int insertNode(int x,int value)
{
	while(x<=32001) 
	{
		c[x]+=value;
		x+=lowbit(x);
	}
	return 0;
}
int getsum(int x)
{
	int sum=0;
	while(x>0){
		sum+=c[x];
		x-=lowbit(x);
	}
	return sum;
}
int res[32010];
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF){
		int x,y;
		memset(res,0,sizeof(res));
		for(int i=0;i<n;i++){
			scanf("%d%d",&x,&y);
			res[getsum(x+1)]++;
			insertNode(x+1,1);
		}
		for(int i=0;i<n;i++){
			printf("%d\n",res[i]);
		}
	}
}
